#include "web/web_utils.h"
#include <vector>

std::vector<uint8_t> matToJpeg(const cv::Mat& img, JPEGQuality quality) {
    std::vector<uint8_t> buf;
    std::vector<int> params = {cv::IMWRITE_JPEG_QUALITY, static_cast<int>(quality)};
    cv::imencode(".jpg", img, buf, params);
    return buf;
}
